home *** CD-ROM | disk | FTP | other *** search
- Path: news.crystalball.com!news
- From: Larry Weiss <lfw@oc.com>
- Newsgroups: comp.lang.c
- Subject: C coding standards
- Date: Mon, 04 Mar 1996 13:32:24 -0600
- Organization: crystalball.com
- Message-ID: <313B4548.45AA@oc.com>
- References: <4g0elg$mdr@redstone.interpath.net> <4h0bbo$c0q@fohnix.metronet.com> <4h7ce0$ojd@news.interpath.net> <4h85sm$lm0@texas.nwlink.com>
- NNTP-Posting-Host: external.oc.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
-
- Teresa Reiko wrote:
- >
- > In this book and others, notably 'Code Complete', these programming
- > guides published by Microsoft Press, it is evident why Microsoft put
- > so many bugs in Windows 95. Here are the three worst Microsoft
- > coding rules, in my opinion at least:
- >
- > Every line of code must contain a comment.
- > Any number greater than 2 must be a named constant.
- > No procedure may be longer than 25 lines.
- >
- > If you follow these rules, you can be sure to write buggy, inefficient
- > code that is difficult to revise and will generally look 'dirty'.
- > Of course, if this is your intent, that's OK, but...
-
-
- Does your organization have any coding guidelines?
-
- If so, what are the rules that you follow with respect to:
- o comment frequency?
- o use of numeric literals?
- o text length of a function?
-
- My organizational guideline's answers to these questions are:
-
- o block comments are better than line-by-line comments, but line-by-line
- comments are allowed; avoid excessive commenting; and there are specific
- typographics formats that comments have, including comments that must be
- formatted to more than one line
-
- o no mention of restrictions on use of numeric literals
-
- o no mention of restrictions on function declaration length, but overall
- a suggestion (not strict) to keep entire modules to less than 1000 lines
- of code
-
- So we do differ from the "Code Complete" guidelines.
-